import service from '@/utils/request'

// @Tags Efficacy
// @Summary 创建功效
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Efficacy true "创建功效"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /efficacy/createEfficacy [post]
export const createEfficacy = (data) => {
  return service({
    url: '/efficacy/createEfficacy',
    method: 'post',
    data
  })
}

// @Tags Efficacy
// @Summary 删除功效
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Efficacy true "删除功效"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /efficacy/deleteEfficacy [delete]
export const deleteEfficacy = (data) => {
  return service({
    url: '/efficacy/deleteEfficacy',
    method: 'delete',
    data
  })
}

// @Tags Efficacy
// @Summary 批量删除功效
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除功效"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /efficacy/deleteEfficacyByIds [delete]
export const deleteEfficacyByIds = (data) => {
  return service({
    url: '/efficacy/deleteEfficacyByIds',
    method: 'delete',
    data
  })
}

// @Tags Efficacy
// @Summary 更新功效
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.Efficacy true "更新功效"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /efficacy/updateEfficacy [put]
export const updateEfficacy = (data) => {
  return service({
    url: '/efficacy/updateEfficacy',
    method: 'put',
    data
  })
}

// @Tags Efficacy
// @Summary 用id查询功效
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.Efficacy true "用id查询功效"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /efficacy/findEfficacy [get]
export const findEfficacy = (params) => {
  return service({
    url: '/efficacy/findEfficacy',
    method: 'get',
    params
  })
}

// @Tags Efficacy
// @Summary 分页获取功效列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取功效列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /efficacy/getEfficacyListByWhere [get]
export const getEfficacyListByWhere = (params) => {
  return service({
    url: '/efficacy/getEfficacyListByWhere',
    method: 'get',
    params
  })
}

export const setEfficacyArticle = (data) => {
  return service({
    url: '/efficacy/setEfficacyArticle',
    method: 'post',
    data
  })
}


export const getEfficacyArticle = (params) => {
  return service({
    url: '/efficacy/getEfficacyArticle',
    method: 'get',
    params
  })
}
